/*
**************************************************************************************
*Myriad Engine                                                                       *
*Copyright (C) 2006-2007, 5d Studios (www.5d-Studios.com)                            *
*                                                                                    *
*This library is free software; you can redistribute it and/or                       *
*modify it under the terms of the GNU Lesser General Public                          *
*License as published by the Free Software Foundation; either                        *
*version 2.1 of the License, or (at your option) any later version.                  *
*                                                                                    *
*This library is distributed in the hope that it will be useful,                     *
*but WITHOUT ANY WARRANTY; without even the implied warranty of                      *
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                   *
*Lesser General Public License for more details.                                     *
*                                                                                    *
*You should have received a copy of the GNU Lesser General Public                    *
*License along with this library; if not, write to the Free Software                 *
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA      *
**************************************************************************************
*/
package leola.frontend.listener;


/**
 * A consumable event of interest.
 * 
 * @author Tony
 *
 */
public abstract class Event {

	/**
	 * The object which this event has
	 * spawned from.
	 */
	private Object source;
		
	/**
	 * If this event has been consumed
	 */
	private boolean consumed;

	/**
	 * Time the event was created.
	 */
//	private long creationTime;
	
	/**
	 * Uses the default method id.
	 * @param source
	 */
	public Event(Object source) {
		this.source = source;
		

//		/* This time is in java time */
//		this.creationTime = System.currentTimeMillis();
	}
	
	
	/**
	 * Consume this event
	 */
	public void consume() {
		this.consumed=true;
	}

	/**
	 * @return the consumed
	 */
	public boolean isConsumed() {
		return consumed;
	}

	/**
	 * Unconsume this event.  
	 */
	public void unconsume() {
		this.consumed = false;
	}
	
	/**
	 * @return the creationTime
	 */
//	public long getCreationTime() {
//		return creationTime;
//	}
	
	/**
	 * Get the source
	 * @return the source of which this event was created.
	 */
	public Object getSource() {
		return this.source;
	}


	/**
	 * @param source the source to set
	 */
	public void setSource(Object source) {
		this.source = source;
	}		
		
}
